{% extends 'users/profile-base.html' %}
{% load static %}
{% load tasks_tags %}

{% block title %}
    Детальная информация
{% endblock title %}

{% block right_frame %}

    <div class="profile-frame__right">
        <div class="one-task-frame glass">
            <div class="backBtnCls">
                <a class="backBtn" href="{% url 'task:main' %}">
                    <img src="{% static 'icons/back_btn.png' %}" alt=""/>
                </a>
            </div>
            
            {% for data in task %}
                <div class="one-task-frame__item-title">
                    <p class="titleText">{{ data.title }}</p>
                </div>
                <div class="one-task-frame__item-description">
                    <p>{{ data.description }}</p>
                </div>
                
                <div class="one-task-frame__item-firstImg">
                    {% if data.start_img %}
                        <img class="preview" src="{{ data.start_img.url }}" alt="">
                    {% else %}
                    
                        {% if data.creation_date|check_date %}
                            <a class="changeBtn" href="{% url 'task:task-change' data.id %}"><img class="addImageIcon" src="{% static 'icons/Add_image_icon.png' %}" alt=""></a>
                        {% endif %}
                    {% endif %}
                </div>

                
                {% if not data.is_done and data.remind_by_date %}
                    <p class='remindeByDate'>Напомнить: {{ data.remind_by_date }}</p>
                {% endif %}
                    

                {% if data.is_done %}

                    <div class="one-task-frame__item-endImg">
                        {% if data.end_img %}
                            <img class="preview" src="{{ data.end_img.url }}" alt="">
                        {% else %}
                            <a class="changeBtn" href="{% url 'task:task-change' data.id %}"><img class="addImageIcon" src="{% static 'icons/Add_image_icon.png' %}" alt=""></a>
                        {% endif %}
                    </div>
                    <div class="endedDate">
                        <p>Выполнено: {{ data.ended_date }}</p>
                    </div>
                    {% if data.done_comment %}
                        <div class="doneComment">
                            <p>{{ data.done_comment }}</p>
                        </div>
                    {% endif %}
                    
                {% else %}
                    <a class="doneBtn" href="{% url 'task:task-done' data.id %}">
                        <img src="{% static 'icons/done.png' %}" alt="">
                    </a>
                {% endif %}
                
                {% if data.creation_date|check_date %}
                    <a class="changeBtn" href="{% url 'task:task-change' data.id %}"><img src="{% static 'icons/change_l.png' %}" alt=""></a>
                {% endif %}
                    
                <!-- <a class="changeBtn" href="{% url 'task:task-change' data.id %}"><img src="{% static 'icons/change_l.png' %}" alt=""></a> -->
                    
                
            {% endfor %}
        </div>
    </div>

{% endblock right_frame %}